package com.dayaokeji.server_api.api;

import com.dayaokeji.server_api.Page;
import com.dayaokeji.server_api.ServerResponse;
import com.dayaokeji.server_api.domain.CourseTask;
import com.dayaokeji.server_api.domain.HomeWorkSubmitBean;
import com.dayaokeji.server_api.domain.SelectTaskDetail;

import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by Gorden on 2018/3/22.
 */

public interface CourseTaskApi {

    @GET("course/classwork/list")
    Call<ServerResponse<Page<CourseTask>>> list(@Query("courseId") String courseId,@Query("start") int start,@Query("length") int length);

    @POST("course/classwork/create")
    Call<ServerResponse<Void>> create(@Body CourseTask courseTask);

    @POST("course/classwork/publish")
    Call<ServerResponse<Void>> publish(@Field("id") String courseId);

    @POST("course/classwork/unpublish")
    Call<ServerResponse<Void>> unpublish(@Field("id") String courseId);

    @POST("course/classwork/delete")
    Call<ServerResponse<Void>> delete(Map<String,Integer> params);

    @POST("course/classwork/update")
    Call<ServerResponse<Void>> update(@Body CourseTask courseTask);

    @POST("course/classwork/commitClasswork")
    Call<ServerResponse<Integer>> submit(@Body HomeWorkSubmitBean courseTask);

    @GET("course/classwork/queryClassworkDetail")
    Call<ServerResponse<CourseTask>> selectTask(@Query("userid") String userid,@Query("courseId") String courseId,@Query("classworkId") String classworkId);



}
